import { registerMicroApps, start } from '../../micro/index';
import { useLoadingStore } from '../store/modules/loading';


export const registerApp = (list: any) => {
    const loadingStore = useLoadingStore();
    // 注册到微前端框架里
    registerMicroApps(list, {
        beforeLoad: [
            () => {
                loadingStore.setLoadingStatus(true)
                console.log('开始加载');
            }
        ],
        mounted: [
            () => {
                loadingStore.setLoadingStatus(false)
                console.log('渲染完成');
            }
        ],
        destroyed: [
            () => {
                console.log('卸载完成')
            }
        ]
    });
    // 开启微前端框架
    start();
};
